package com.shop.config;

import com.cloopen.rest.sdk.CCPRestSmsSDK;
import com.shop.comment.Constants;

import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig{
		// 商户appid
		public static String APPID ;//= "2016102500755218";
		// 私钥 pkcs8格式的
		public static String RSA_PRIVATE_KEY;// = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCp+eQfXXvmHnQS1/4+Mtauw0L/OaPaeuM5vcPi223VLzkt0xlpeUw2Dd5JjYwxzd3DF5GzPWgRPEagMJpqBJnmILBPkhuHd+0HLz0U2dlmvZPtNGdvRLyZ5yaQNg7IFPtVmkYIzpaLf2nyCNMzPZD/7bKnLzaVz8IW8tq/8nUeWkpt+B0LXMXnntwOAZ2PiXthSZCsnQfo1HvK29jcUd5suxIgrq4uZlZuEPxZCPEL8uHL2t6ObxkC+iw6hP2r0KCBO6V8jnoLy4c3NzUo3jeXqePtyP6TxCtZfaSjMOSOaxHG7vD8Ap+Gta++w6ycN3hqNYceDnvafU+w0zHsjrgpAgMBAAECggEAP9lYsdeB9R03aOSt4ltifV9nyUuzmxxSQpxf+tWGWnBUwDvt7crcr+lhuKttIEA+r0wpNPU6JE9KEF5xgqWb0fAxipJNuQN5jBtYjH6QxaEs8gufVxKw7fcAa2eDAfGvv6Yl7KT9tAT2nS5nd3YHA7wcQeTgUkIqnEg5l6TSDcYpqipt15imdkNn1jtHj90IgDmpsEGd3QdMkfg+ztpjx3KF6ZRNc3GZr+IJ1fzFnKZWvUVhEQEla0O1TAzzlZn2s0e4IDBxIDtxWEypz0BfC0SQ0Ti+jHyNutbnCd5gdWC2f2ElUuFD6zW3TEW4cbiyiUIoMByI1J/vnmGrmvzyqQKBgQD58FnSNWMpCJWm+1KS45SmRgtFkYbuAmQFZYDa1ap+veUCc/QWXhOVK0t2tushW5p7eEUHYRgJBv6S89S+e0l2YezJKnvkdWPyBLYIxiqdvJoMMocTOdSe6PEWfC9EkYLkTFqBUmt0lJ+p+z3NKueepO8MBmDti7yz8vApv5hbewKBgQCuGR9XsEjKE31HW6bO0xd0/JtCqamTuhYZqoqMerwPnPe9UH0KqWujW+Xtiewb1egZFmrztSsSGfYk1PFZA8FKjc1miy1rrEcp135NWdb+6nojqppf7lEGjL6InLUF9kfz6Np5z7+Rznvn1fsU62dkHjMPu0QPSJFFIu4ODffHqwKBgQDKpCs++lgGOdaTxupg+7FWyi1zXxUFvdx4X56ETn3oOnAFeBurUuUPqUWK361to0Zx2sYkwHzrPMeEP7r6IR0jpSuEwjQmu2KoI1evb3O35eUEBKdtWBLiMDzfnRn5vvxfuuQaO8exgpqdB31I7gNSpajGmBlYH1aEk3BSeOu/JwKBgHp409KlAV+efDfxopPGba7vcO1hWxjABIIDtbmDMb6uBp1X/M6+RilCIaqLptwiC0dyvMQ6g1UVjFF2t12ORbCDtqXXbJldNSabII+bjqH/IvLqNfUcOkWoRvTlgHb0PMO5389nNPWGUyXRIvMhcrc8g2EitIsn2oHPQ7YBX3hHAoGAO8SkFJu2dS/hp7GT8gksX3y+tNIbaHddJBnzi0D2yvUWjWknmpTG9TwtppOs5ygBvbxw2P7z1BDwCca/dhvsEgGsTFxCVMFuf/NSWXUZlF7AaCZ9x+Y8GLoeC1MATecM+VZXOHMId9J21ZFCvbPsajOyMXPGX+GNYmi49Dgcmi8=";
		// 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
		public static String notify_url;// = "http://localhost:8080/InterestingShop/client/pay/notify_url.jsp";
		// 页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 商户可以自定义同步跳转地址
		public static String return_url;// = "http://localhost:8080/InterestingShop/client/buycar/BuyCar_Three.jsp";
		// 请求网关地址
		public static String URL;// = "https://openapi.alipaydev.com/gateway.do";
		// 编码
		public static String CHARSET;// = "UTF-8";
		// 返回格式
		public static String FORMAT;// = "json";
		// 支付宝公钥
		public static String ALIPAY_PUBLIC_KEY;// = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfnkH1175h50Etf+PjLWrsNC/zmj2nrjOb3D4ttt1S85LdMZaXlMNg3eSY2MMc3dwxeRsz1oETxGoDCaagSZ5iCwT5Ibh3ftBy89FNnZZr2T7TRnb0S8mecmkDYOyBT7VZpGCM6Wi39p8gjTMz2Q/+2ypy82lc/CFvLav/J1HlpKbfgdC1zF557cDgGdj4l7YUmQrJ0H6NR7ytvY3FHebLsSIK6uLmZWbhD8WQjxC/Lhy9rejm8ZAvosOoT9q9CggTulfI56C8uHNzc1KN43l6nj7cj+k8QrWX2kozDkjmsRxu7w/AKfhrWvvsOsnDd4ajWHHg572n1PsNMx7I64KQIDAQAB";
		// 日志记录目录
		public static String log_path;// = "/log";
		// RSA2
		public static String SIGNTYPE;// = "RSA2";


	static {
		init();
	}

	private static void init(){
		Properties params = new Properties();
		String configFile = Constants.Properties.ALIPAY_CONFIG;
		InputStream is = AlipayConfig.class.getClassLoader().getResourceAsStream(configFile);
		try {
			params.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
		APPID = params.getProperty("ali.pay.appID");
		RSA_PRIVATE_KEY = params.getProperty("ali.pay.rsaPrivateKey");
		ALIPAY_PUBLIC_KEY = params.getProperty("ali.pay.alipayPublicKey");
		notify_url = params.getProperty("ali.pay.notifyUrl");
		return_url = params.getProperty("ali.pay.returnUrl");
		URL = params.getProperty("ali.pay.gateway");
		CHARSET = params.getProperty("ali.pay.charset");
		FORMAT = params.getProperty("ali.pay.format");
		log_path = params.getProperty("ali.pay.logPath");
		SIGNTYPE = params.getProperty("ali.pay.signType");

	}



}

